package managesystem.poverty;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @author The setting sun
 * @version 1.0
 * @title: HintDialog
 * @description: TODO
 * @date 2021/12/6 10:43
 */
public class PovertyHintDialog {
    public static void main(String[] args) {
        new BindSuccessHint().init();
    }
}

class BindFailureHint extends JDialog {
    JLabel hint = new JLabel("要绑定的贫困用户不存在，请重试！");
    JButton comfirm = new JButton("确认");

    public void init() {
        comfirm.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });

        hint.setForeground(Color.RED);
        hint.setFont(new Font("微软雅黑", 1, 18));
        comfirm.setFont(new Font("微软雅黑", 1, 16));

        setLayout(new FlowLayout());

        add(hint);
        add(comfirm);

        setVisible(true);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setSize(350, 130);
    }
}

class ShowOnePovertyFailureHint extends JDialog {
    JLabel hint = new JLabel("要查询的贫困用户不存在，请重试！");
    JButton comfirm = new JButton("确认");

    public void init() {
        comfirm.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });

        hint.setForeground(Color.RED);
        hint.setFont(new Font("微软雅黑", 1, 18));
        comfirm.setFont(new Font("微软雅黑", 1, 16));

        setLayout(new FlowLayout());

        add(hint);
        add(comfirm);

        setVisible(true);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setSize(350, 130);
    }
}

class ShowOneItemFailureHint extends JDialog {
    JLabel hint = new JLabel("要查询的贫困项目不存在，请重试！");
    JButton comfirm = new JButton("确认");

    public void init() {
        comfirm.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });

        hint.setForeground(Color.RED);
        hint.setFont(new Font("微软雅黑", 1, 18));
        comfirm.setFont(new Font("微软雅黑", 1, 16));

        setLayout(new FlowLayout());

        add(hint);
        add(comfirm);

        setVisible(true);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setSize(350, 130);
    }
}

class BindSuccessHint extends JDialog {
    JLabel hint = new JLabel("贫困用户绑定成功");
    JButton comfirm = new JButton("确认");

    public void init() {
        comfirm.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });

        hint.setForeground(Color.RED);
        hint.setFont(new Font("微软雅黑", 1, 18));
        comfirm.setFont(new Font("微软雅黑", 1, 16));

        setLayout(new FlowLayout());

        add(hint);
        add(comfirm);

        setVisible(true);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setSize(200, 130);
    }
}

class PovertyHidIsNULLHint extends JDialog {
    JLabel hint = new JLabel("你现在还没有帮扶人员，记得修改个人信息哦");
    JButton comfirm = new JButton("确认");

    public void init() {
        comfirm.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });

        hint.setForeground(Color.RED);
        hint.setFont(new Font("微软雅黑", 1, 18));
        comfirm.setFont(new Font("微软雅黑", 1, 16));

        setLayout(new FlowLayout());

        add(hint);
        add(comfirm);

        setVisible(true);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setSize(450, 130);
    }
}

class PovertyIidIsNULLHint extends JDialog {
    JLabel hint = new JLabel("你现在还没有贫困项目，记得修改个人信息哦");
    JButton comfirm = new JButton("确认");

    public void init() {
        comfirm.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });

        hint.setForeground(Color.RED);
        hint.setFont(new Font("微软雅黑", 1, 18));
        comfirm.setFont(new Font("微软雅黑", 1, 16));

        setLayout(new FlowLayout());

        add(hint);
        add(comfirm);

        setVisible(true);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setSize(450, 130);
    }
}

class PovertyHidIidIsNULLHint extends JDialog {
    JLabel hint = new JLabel("你现在还没有帮扶人员和贫困项目，记得修改个人信息哦");
    JButton comfirm = new JButton("确认");

    public void init() {
        comfirm.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });

        hint.setForeground(Color.RED);
        hint.setFont(new Font("微软雅黑", 1, 18));
        comfirm.setFont(new Font("微软雅黑", 1, 16));

        setLayout(new FlowLayout());

        add(hint);
        add(comfirm);

        setVisible(true);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setSize(500, 130);
    }
}